<template>
  <div>
  </div>
</template>
<script>
import axios from 'axios'
export default {
  mounted() {
    this.fetch()
  },
  props: {
    isJson: { type: [Boolean] },
    paramCode: { type: [String] },
  },
  data() {
    return {
    }
  },
  methods: {
    fetch() {
      axios({
        method: 'get',
        url: '/infra/param/getParam',
        params: {
          paramCode: this.paramCode,
        },
      }).then((res) => {
        let paramValue = res.data || ''
        if (this.isJson) {
          paramValue = JSON.parse(paramValue)
        }
        this.$emit('fetch', paramValue)
      }).catch(() => {

      })
    },
  }
}
</script>
